Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

XCM Revamp Continued #2865

Merged
merged 25 commits into from
Apr 9, 2021
Merged

XCM Revamp Continued #2865

merged 25 commits into from
Apr 9, 2021

Conversation

gavofyork
Copy link
Member

@gavofyork gavofyork commented Apr 9, 2021

Tracking issue: #2841

This batch of work is mostly to allow governance VMP messages.

  • Add pallet-xcm, this is a pallet which contains dispatchables to send and execute XCM messages. Also contains a MultiLocation Origin and a corresponding EnsureOrigin implementation to recognise it as well as a body-majority.
  • Hardening of UMP message pocessing:
    • Alter process_upward_message in order to take the acceptable amount of weight to spend processing the message, and return an Option to indicate whether the weight limit was reached.
    • Limit the amount of weight that can be processed for UMP dispatch and provide a trapdoor for the first message to help ensure it keeps processing in unexpectedly heavy situations.
  • Various refactorings.
  • Add XcmPallet to Rococo runtime.

TODO in another PR:

  • Add a collective pallet to Rococo runtime.

@gavofyork gavofyork added A3-in_progress Pull request is in progress. No review needed at this stage. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. labels Apr 9, 2021
@gavofyork gavofyork mentioned this pull request Apr 9, 2021
47 tasks
@gavofyork gavofyork added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Apr 9, 2021
Comment on lines +340 to +341
// we increase the amount of weight that we're allowed to use on the first message to try to prevent
// the possibility of blockage of the queue.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this scenario is not quite clear to me yet

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original UMP dispatcher guaraunteed one dispatch per block minimum with the weight limitation being a soft cap. This kept things running the case of a single heavy message. Now, we don't quite guarantee that, but the soft-cap gets lifted to this hard-cap for the first message per block to try to mitigate any blockage.

gavofyork and others added 3 commits April 9, 2021 19:45
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
fn execute_xcm(_origin: MultiLocation, _message: Xcm<C>, _weight_limit: Weight) -> Outcome {
Outcome::Error(Error::Unimplemented)
}
}

/// Utility for sending an XCM message.
///
/// These can be amalgamted in tuples to form sophisticated routing systems.
pub trait SendXcm {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was reading this few hours ago and this was a fundamental part of the code without docs, thanks for filling 👍

@gavofyork gavofyork merged commit 11a9afa into master Apr 9, 2021
@gavofyork gavofyork deleted the gav-xcm-origins branch April 9, 2021 18:34
rphmeier pushed a commit that referenced this pull request Apr 9, 2021
* Introduce plurality XCM locations

* Add RelayedFrom

* DMP dispatch weight handling.

* Add pallet for XCM sending, add routing logic.

* Update error types & doc

* Fix warnings.

* Fixes

* Fixes

* Fixes

* Bump Substrate

* Fixes

* Docs

* Docs

* Docs

* Fixes

* Fixes

* Fixes

* Update xcm/pallet-xcm/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Docs

* Fixes

* Update lib.rs

* Fixes

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants